-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
follow up #15951 #17478
follow up #15951 #17478
Conversation
@@ -113,3 +113,94 @@ func strip*(a: var string, leading = true, trailing = true, chars: set[char] = w | |||
assert c == "X" | |||
|
|||
setSlice(a, stripSlice(a, leading, trailing, chars)) | |||
|
|||
proc isLowerAscii*(c: char): bool {.inline.} = | |||
## Checks whether or not `c` is a lower case character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Checks whether or not `c` is a lower case character. | |
## Checks whether or not `c` is a lowercase ASCII character. |
c in {'a'..'z'} | ||
|
||
proc isUpperAscii*(c: char): bool {.inline.} = | ||
## Checks whether or not `c` is an upper case character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Checks whether or not `c` is an upper case character. | |
## Checks whether or not `c` is an uppercase ASCII character. |
The new |
will review tomorrow |
if isInit and n > n0: | ||
zeroMem(result[n0].addr, n - n0) | ||
|
||
proc forceCopy*(result: var string, a: string) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't https://nim-lang.org/docs/system.html#deepCopy%2CT%2CT be used?
|
||
proc forceCopy*(result: var string, a: string) = | ||
## Always forces a copy no matter whether `a` is shallow. | ||
# the naitve `result = a` would not work if `a` is shallow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# the naitve `result = a` would not work if `a` is shallow | |
# the naive `result = a` would not work if `a` is shallow |
Are these useful "basics" though? I never used strutils2.nim. |
Sorry, rejected. Additions to |
follow up #15951 and #16280
remove
compiler/strutils2
and move the procs tostd/strbasics
.